home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / cmsrc392.zip / SYM.MF < prev    next >
Text File  |  1992-03-30  |  19KB  |  459 lines

  1. % This file generates the following characters when their codes are known:
  2. % |minus|, |plus_minus|, |o_plus|, |o_times|,
  3. % |cup|, |cap|, |meet|, |join|,
  4. % |down_arrow|, |up_arrow|,
  5. % |left_arrow|, |right_arrow|, |double_arrow|,
  6. % |subset|, |superset|, |elt|,
  7. % |for_all|, |there_exists|, |false_that|,
  8. % |less|, |greater|, |underbar|,
  9. % |neq|, |leq|, |geq|, |eqv|,
  10. % |backslash|, |vertical|,
  11. % |cdot|, |diamond|,
  12. % |left_brace|, |right_brace|,
  13. % |straight_quotes|, |infty|, |integral|.
  14.  
  15. iff known minus: cmchar "Minus sign";
  16. beginarithchar(minus); pickup rule.nib;
  17. lft x1=hround 1.5u-eps; x2=w-x1; y1=y2=math_axis;
  18. draw z1--z2;  % bar
  19. labels(1,2); endchar;
  20.  
  21. iff known plus_minus: cmchar "Plus-or-minus sign";
  22. beginarithchar(plus_minus); pickup rule.nib;
  23. numeric shiftup; shiftup=vround 1.5u;
  24. x1=x2=.5w; lft x3=lft x5=hround u-eps; x4=x6=w-x3;
  25. .5[y1,y2]=y3=y4=math_axis+shiftup; top y1=h+shiftup; y5=y6=y2;
  26. draw z1--z2;  % stem
  27. draw z3--z4;  % plus bar
  28. draw z5--z6;  % minus bar
  29. labels(1,2,3,4,5,6); endchar;
  30.  
  31. iff known o_plus: cmchar "Circle-plus operator";
  32. beginarithchar(o_plus); pickup light_rule.nib; autorounded;
  33. lft x6=hround u; x2=w-x6; y2=math_axis; top y8=h;
  34. circle_points; draw_circle;  % circle
  35. draw z2--z6; draw z4--z8;  % bar and stem
  36. labels(1,2,3,4,5,6,7,8); endchar;
  37.  
  38. iff known o_times: cmchar "Circle-times operator";
  39. beginarithchar(o_times); pickup light_rule.nib; autorounded;
  40. lft x6=hround u; x2=w-x6; y2=math_axis; top y8=h;
  41. circle_points; draw_circle;  % circle
  42. draw z1--z5; draw z3--z7;  % diagonals
  43. labels(1,2,3,4,5,6,7,8); endchar;
  44.  
  45. iff known cup: cmchar "Set union sign";
  46. beginchar(cup,12u#,.8asc_height#,0);
  47. italcorr .8asc_height#*slant-.5u#;
  48. adjust_fit(0,0); pickup rule.nib; autorounded;
  49. lft x1=hround u; x2=x1; x3=w-x3; x4=x5=w-x1;
  50. y1=good.y h+o; bot y3=-o; y2=y4=2/3[y1,y3]; y5=y1;
  51. draw z1---z2...z3...z4---z5;  % stems and cup
  52. labels(1,2,3,4,5); endchar;
  53.  
  54. iff known cap: cmchar "Set intersection sign";
  55. beginchar(cap,12u#,.8asc_height#,0);
  56. italcorr .8asc_height#*slant-.5u#;
  57. adjust_fit(0,0); pickup rule.nib; autorounded;
  58. lft x1=hround u; x2=x1; x3=w-x3; x4=x5=w-x1;
  59. y3=good.y h+o; bot y1=-o; y2=y4=2/3[y1,y3]; y5=y1;
  60. draw z1---z2...z3...z4---z5;  % stems and cap
  61. labels(1,2,3,4,5); endchar;
  62.  
  63. iff known meet: cmchar "Lattice infimum (logical and) sign";
  64. beginchar(meet,12u#,.8asc_height#,0);
  65. italcorr .8asc_height#*slant-.5u#;
  66. adjust_fit(0,0); pickup rule.nib;
  67. lft x1=hround u-eps; x3=w-x3; x5=w-x1;
  68. y3=good.y h+o; bot y1=-o; y5=y1;
  69. draw z1--z3--z5;  % diagonals
  70. labels(1,3,5); endchar;
  71.  
  72. iff known join: cmchar "Lattice supremum (logical or) sign";
  73. beginchar(join,12u#,.8asc_height#,0);
  74. italcorr .8asc_height#*slant-.5u#;
  75. adjust_fit(0,0); pickup rule.nib;
  76. lft x1=hround u-eps; x3=w-x3; x5=w-x1;
  77. y1=good.y h+o; bot y3=-o; y5=y1;
  78. draw z1--z3--z5;  % diagonals
  79. labels(1,3,5); endchar;
  80.  
  81. iff known down_arrow: cmchar "Downward arrow";
  82. beginchar(down_arrow,9u#,asc_height#,asc_depth#);
  83. adjust_fit(0,0); pickup crisp.nib;
  84. pos1(rule_thickness,0); pos2(rule_thickness,0);
  85. pos3(rule_thickness,90); pos4(rule_thickness,90);
  86. lft x1l=hround(.5w-.5rule_thickness); y1+.5rule_thickness=h;
  87. x0=x1=x2; bot y0=-d; x0-x3=x4-x0=if monospace:3u else:4u fi+eps;
  88. y3=y4=y0+if monospace:.24 else:.36 fi asc_height+eps;
  89. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  90. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  91. z9=.2[.5[z3,z4],z0];
  92. numeric t; path p; p=z4r{z9-z4}..z6r;
  93. t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
  94. filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
  95.  --z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3r{z9-z3}..z5r)
  96.  --z3l{z9-z3}..z0 & cycle;  % arrowhead and stem
  97. penlabels(0,1,2,3,4,5,6,9); endchar;
  98.  
  99. iff known up_arrow: cmchar "Upward arrow";
  100. beginchar(up_arrow,9u#,asc_height#,asc_depth#);
  101. italcorr .76asc_height#*slant+.5crisp#-u#;
  102. adjust_fit(0,0); pickup crisp.nib;
  103. pos1(rule_thickness,0); pos2(rule_thickness,0);
  104. pos3(rule_thickness,90); pos4(rule_thickness,90);
  105. lft x1l=hround(.5w-.5rule_thickness); y1-.5rule_thickness=-d;
  106. x0=x1=x2; top y0=h; x0-x3=x4-x0=if monospace:3u else:4u fi+eps;
  107. y3=y4=y0-if monospace:.24 else:.36 fi asc_height-eps;
  108. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  109. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  110. z9=.2[.5[z3,z4],z0];
  111. numeric t; path p; p=z4l{z9-z4}..z6r;
  112. t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
  113. filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
  114.  --z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3l{z9-z3}..z5r)
  115.  --z3r{z9-z3}..z0 & cycle;  % arrowhead and stem
  116. penlabels(0,1,2,3,4,5,6,9); endchar;
  117.  
  118. iff known left_arrow: cmchar "Leftward arrow";
  119. compute_spread(.45x_height#,.55x_height#);
  120. beginchar(left_arrow,18u#,v_center(spread#+rule_thickness#));
  121. adjust_fit(0,0); pickup crisp.nib;
  122. pos1(rule_thickness,90); pos2(rule_thickness,90);
  123. pos3(rule_thickness,0); pos4(rule_thickness,0);
  124. y0=y1=y2=math_axis; x1+.5rule_thickness=hround(w-u); lft x0=hround u;
  125. y3-y0=y0-y4=if monospace:.24 else:.36 fi asc_height+eps;
  126. x3=x4=x0+if monospace:3u else:4u fi+eps;
  127. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  128. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  129. z9=.2[.5[z3,z4],z0];
  130. numeric t; path p; p=z4r{z9-z4}..z6r;
  131. t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p;
  132. filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
  133.  --z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3r{z9-z3}..z5r)
  134.  --z3l{z9-z3}..z0 & cycle;  % arrowhead and stem
  135. penlabels(0,1,2,3,4,5,6,9); endchar;
  136.  
  137. iff known right_arrow: cmchar "Rightward arrow";
  138. compute_spread(.45x_height#,.55x_height#);
  139. beginchar(right_arrow,18u#,v_center(spread#+rule_thickness#));
  140. adjust_fit(0,0); pickup crisp.nib;
  141. pos1(rule_thickness,90); pos2(rule_thickness,90);
  142. pos3(rule_thickness,0); pos4(rule_thickness,0);
  143. y0=y1=y2=math_axis; x1-.5rule_thickness=hround u; rt x0=hround(w-u);
  144. y3-y0=y0-y4=if monospace:.24 else:.36 fi asc_height+eps;
  145. x3=x4=x0-if monospace:3u else:4u fi-eps;
  146. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  147. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  148. z9=.2[.5[z3,z4],z0];
  149. numeric t; path p; p=z4l{z9-z4}..z6r;
  150. t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p;
  151. filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
  152.  --z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3l{z9-z3}..z5r)
  153.  --z3r{z9-z3}..z0 & cycle;  % arrowhead and stem
  154. penlabels(0,1,2,3,4,5,6,9); endchar;
  155.  
  156. iff known double_arrow: cmchar "Left-and-right arrow";
  157. compute_spread(.45x_height#,.55x_height#);
  158. beginchar(double_arrow,18u#,
  159.  v_center(if monospace:.6asc_height#+fi spread#+rule_thickness#));
  160. adjust_fit(0,0); pickup crisp.nib;
  161. pos1(rule_thickness,90); pos2(rule_thickness,90);
  162. pos3(rule_thickness,0); pos4(rule_thickness,0);
  163. y0=y1=y2=math_axis if monospace:+vround.3asc_height fi; lft x0=hround u;
  164. if monospace: x1+.5rule_thickness=hround(w-u) else: x1=.5w fi;
  165. y3-y0=y0-y4=if monospace:.24 else:.36 fi asc_height+eps;
  166. x3=x4=x0+if monospace:3u else:4u fi+eps;
  167. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  168. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  169. z9=.2[.5[z3,z4],z0];
  170. numeric t; path p; p=z4r{z9-z4}..z6r;
  171. t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p;
  172. filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
  173.  --z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3r{z9-z3}..z5r)
  174.  --z3l{z9-z3}..z0 & cycle;  % left arrowhead and stem
  175. pos11(rule_thickness,90); pos12(rule_thickness,90);
  176. pos13(rule_thickness,0); pos14(rule_thickness,0);
  177. y10=y11=y12=math_axis if monospace:-vround.3asc_height fi;
  178. rt x10=hround(w-u);
  179. if monospace: x11-.5rule_thickness=hround u else: x11=.5w fi;
  180. y13-y10=y10-y14=if monospace:.24 else:.36 fi asc_height+eps;
  181. x13=x14=x10-if monospace:3u else:4u fi-eps;
  182. pos15(rule_thickness,angle(z14-z10)); z15l=z10;
  183. pos16(rule_thickness,angle(z13-z10)); z16l=z10;
  184. z19=.2[.5[z13,z14],z10];
  185. numeric t; path p; p=z14l{z19-z14}..z16r;
  186. t=xpart(p intersectiontimes((0,y12l)--(w,y12l))); x12=xpart point t of p;
  187. filldraw z10..{z14-z19}z14r--subpath (0,t) of\\(z14l{z19-z14}..z16r)
  188.  --z12l---z11l..z11r---z12r--subpath (t,0) of\\(z13l{z19-z13}..z15r)
  189.  --z13r{z19-z13}..z10 & cycle;  % right arrowhead and stem
  190. penlabels(0,1,2,3,4,5,6,9,10,11,12,13,14,15,16,19); endchar;
  191.  
  192. iff known subset: cmchar "Proper subset sign";
  193. compute_spread(5/4x_height#,3/2x_height#);
  194. beginchar(subset,14u#,v_center(spread#+rule_thickness#));
  195. italcorr h#*slant-u#;
  196. adjust_fit(0,0); pickup rule.nib; autorounded;
  197. lft x2=hround 1.5u-eps; x1=x3=w-x2;
  198. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  199. x4=x5=.5w; y4=y1; y5=y3;
  200. draw z1---z4...z2{down}...z5---z3;  % arc and bars
  201. labels(1,2,3,4,5); endchar;
  202.  
  203. iff known superset: cmchar "Proper superset sign";
  204. compute_spread(5/4x_height#,3/2x_height#);
  205. beginchar(superset,14u#,v_center(spread#+rule_thickness#));
  206. italcorr h#*slant-u#;
  207. adjust_fit(0,0); pickup rule.nib; autorounded;
  208. lft x1=hround 1.5u-eps; x2=w-x1; x3=x1;
  209. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  210. x4=x5=.5w; y4=y1; y5=y3;
  211. draw z1---z4...z2{down}...z5---z3;  % arc and bars
  212. labels(1,2,3,4,5); endchar;
  213.  
  214. iff known elt: cmchar "Element sign";
  215. compute_spread(5/4x_height#,3/2x_height#);
  216. beginchar(elt,12u#,v_center(spread#+rule_thickness#));
  217. italcorr h#*slant-u#;
  218. adjust_fit(0,0); pickup rule.nib; autorounded;
  219. lft x2=hround 1.5u-eps; x1=x3=x6=w-x2;
  220. y1-y3=spread; y2=y6=.5[y1,y3]=math_axis;
  221. x4=x5=.5w+u; y4=y1; y5=y3;
  222. draw z1---z4...z2{down}...z5---z3;  % arc and bars
  223. draw z2--z6;  % middle bar
  224. labels(1,2,3,4,5,6); endchar;
  225.  
  226. iff known for_all: cmchar "Universal quantifier";
  227. beginchar(for_all,10u#,asc_height#,0);
  228. italcorr asc_height#*slant;
  229. adjust_fit(0,0); pickup rule.nib;
  230. x2=good.x .5w; center_on(x2);
  231. lft x1=0; x3=w-x1;
  232. top y1=h; bot y2=-o; y3=y1; y4=y5=good.y x_height;
  233. z4=whatever[z1,z2]; z5=whatever[z2,z3];
  234. draw z1--z2--z3;  % diagonals
  235. draw z4--z5;  % bar
  236. labels(1,2,3,4,5); endchar;
  237.  
  238. iff known there_exists: cmchar "Existential quantifier";
  239. beginchar(there_exists,10u#,asc_height#,0);
  240. italcorr asc_height#*slant;
  241. adjust_fit(0,0); pickup rule.nib;
  242. lft x1=hround u-eps; x2=x3=x5=w-x1; x4=x6-.25u=x1;
  243. top y1=h; bot y4=0; y2=y1; y5=y6=.5[y1,y3]; y3=y4;
  244. draw z1--z2--z3--z4;  % upper bar, stem, lower bar
  245. draw z5--z6;  % middle bar
  246. labels(1,2,3,4,5,6); endchar;
  247.  
  248. iff known false_that: cmchar "Logical not sign";
  249. beginchar(false_that,12u#,x_height#,0);
  250. italcorr x_height#*slant-.5u#;
  251. adjust_fit(0,0); pickup rule.nib;
  252. lft x1=hround u-eps; x2=x3=w-x1;
  253. y1=y2=good.y .5[bar_height,h]; y2-y3=1.2(h-bar_height);
  254. draw z1--z2--z3;  % bar and stem
  255. labels(1,2,3); endchar;
  256.  
  257. iff known less: cmchar "Less than sign";
  258. compute_spread(5/4x_height#,3/2x_height#);
  259. beginchar(less,14u#,v_center(spread#+rule_thickness#));
  260. italcorr h#*slant-u#;
  261. adjust_fit(0,0); pickup rule.nib;
  262. lft x2=hround 1.5u-eps; x1=x3=w-x2;
  263. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  264. draw z1--z2--z3;  % diagonals
  265. labels(1,2,3); endchar;
  266.  
  267. iff known greater: cmchar "Greater than sign";
  268. compute_spread(5/4x_height#,3/2x_height#);
  269. beginchar(greater,14u#,v_center(spread#+rule_thickness#));
  270. italcorr math_axis#*slant-u#;
  271. adjust_fit(0,0); pickup rule.nib;
  272. rt x2=hround(w-1.5u)+eps; x1=x3=w-x2;
  273. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  274. draw z1--z2--z3;  % diagonals
  275. labels(1,2,3); endchar;
  276.  
  277. iff known underbar: cmchar "Underbar suitable for < and >";
  278. compute_spread((5/8+.45)*x_height#,(3/4+.55)*x_height#);
  279. beginchar(underbar,14u#,0,spread#-math_axis#+.5rule_thickness#);
  280. adjust_fit(0,0); pickup rule.nib;
  281. lft x1=hround 1.5u-eps; x2=w-x1; bot y1=bot y2=-d;
  282. draw z1--z2;  % bar
  283. labels(1,2); endchar;
  284.  
  285. iff known neq: cmchar "Unequals sign";
  286. compute_spread(.45x_height#,.55x_height#);
  287. beginchar(neq,14u#,v_center(4spread#+rule_thickness#));
  288. italcorr h#*slant-.5u#;
  289. adjust_fit(0,0); pickup rule.nib;
  290. lft x1=hround u-eps; x3=x1; x2=x4=w-x1;
  291. y1=y2; y3=y4; y1-y3=spread; .5[y1,y3]=math_axis;
  292. draw z1--z2; draw z3--z4;  % bars
  293. lft x6=hround 3.5u-eps; x5=w-x6; top y5=h+o; bot y6=-d-o;
  294. draw z5--z6;  % diagonal
  295. labels(1,2,3,4,5,6); endchar;
  296.  
  297. iff known leq: cmchar "Less than or equal to sign";
  298. compute_spread(.45x_height#,.55x_height#);
  299. spread#':=spread#; spread':=spread; % the spread of `$=$'
  300. compute_spread(5/4x_height#,3/2x_height#);
  301. beginchar(leq,14u#,v_center(spread#'+spread#+rule_thickness#));
  302. italcorr h#*slant-u#;
  303. adjust_fit(0,0); pickup rule.nib;
  304. lft x2=hround 1.5u-eps; x1=x3=w-x2;
  305. y1-y3=spread; y2=.5[y1,y3]; top y1=h;
  306. draw z1--z2--z3;  % diagonals
  307. x8=x1; x9=x2; y8=y9; y3-y9=spread'; draw z8--z9;  % bar
  308. labels(1,2,3,8,9); endchar;
  309.  
  310. iff known geq: cmchar "Greater than or equal to sign";
  311. compute_spread(.45x_height#,.55x_height#);
  312. spread#':=spread#; spread':=spread; % the spread of `$=$'
  313. compute_spread(5/4x_height#,3/2x_height#);
  314. beginchar(geq,14u#,v_center(spread#'+spread#+rule_thickness#));
  315. italcorr h#*slant-u#;
  316. adjust_fit(0,0); pickup rule.nib;
  317. lft x1=hround 1.5u-eps; x2=w-x1; x3=x1;
  318. y1-y3=spread; y2=.5[y1,y3]; top y1=h;
  319. draw z1--z2--z3;  % diagonals
  320. x8=x1; x9=x2; y8=y9; y3-y9=spread'; draw z8--z9;  % bar
  321. labels(1,2,3,8,9); endchar;
  322.  
  323. iff known eqv: cmchar "Equivalence or congruence sign";
  324. compute_spread(.45x_height#,.55x_height#);
  325. beginchar(eqv,14u#,v_center(2spread#+rule_thickness#));
  326. italcorr h#*slant-.5u#;
  327. adjust_fit(0,0); pickup rule.nib;
  328. lft x1=hround u-eps; x3=x5=x1; x2=x4=x6=w-x1;
  329. y1=y2; y3=y4=math_axis; y5=y6; y1-y3=y3-y5=spread;
  330. draw z1--z2;  % upper bar
  331. draw z3--z4;  % middle bar
  332. draw z5--z6;  % lower bar
  333. labels(1,2,3,4,5,6); endchar;
  334.  
  335. iff known backslash: cmchar "Reverse slash (backslash)";
  336. beginchar(backslash,9u#,body_height#,paren_depth#);
  337. adjust_fit(0,0); pickup rule.nib;
  338. lft x1=hround u-eps; top y1=h+eps;
  339. rt x2=hround(w-u)+eps; bot y2=-d-eps;
  340. draw z1--z2;  % diagonal
  341. labels(1,2); endchar;
  342.  
  343. iff known vertical: cmchar "Vertical line";
  344. beginchar(vertical,5u#,body_height#,paren_depth#);
  345. italcorr body_height#*slant+.5rule_thickness#-2u#;
  346. adjust_fit(0,0); pickup rule.nib;
  347. x1=x2=good.x .5w; top y1=h+eps; bot y2=-d-eps;
  348. draw z1--z2;  % stem
  349. labels(1,2); endchar;
  350.  
  351. iff known cdot: cmchar "Period raised to axis height";
  352. beginchar(cdot,5u#,v_center(7u#));
  353. adjust_fit(0,0); pickup fine.nib;
  354. numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
  355. define_whole_blacker_pixels(dot_diam);
  356. pos1(dot_diam,0); pos2(dot_diam,90);
  357. lft x1l=hround(.5w-.5dot_diam); y1+.5dot_diam=vround(math_axis+.5dot_diam);
  358. z1=z2; dot(1,2);  % dot
  359. penlabels(1,2); endchar;
  360.  
  361. iff known diamond: cmchar "Diamond operator";
  362. beginchar(diamond,9u#,v_center(7u#));
  363. italcorr math_axis#*slant;
  364. adjust_fit(0,0); pickup rule.nib;
  365. numeric a; a=(lft 3.5u)*sqrt(3.14159/2); % an attempt to match circle area
  366. x4=x8=good.x .5w; center_on(x4); x2=w-x6=good.x(x4+a);
  367. y2=y6=.5[y4,y8]=math_axis; y8=good.y(y2+a);
  368. draw z2--z4--z6--z8--cycle;  % bowl
  369. labels(2,4,6,8); endchar;
  370.  
  371. iff known left_brace: cmchar "Left curly brace";
  372. beginchar(left_brace,9u#,body_height#,paren_depth#);
  373. italcorr body_height#*slant+.5vair#-u#;
  374. adjust_fit(0,0); pickup fine.nib;
  375. forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
  376. forsuffixes $=2,3,5,6: pos$(stem,0); endfor
  377. x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
  378. lft x4l=hround(1.5u-.5vair); lft x2l=hround(.5w-.5stem);
  379. top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
  380. y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
  381. filldraw z1l{left}...z2l---z3l...{left}z4l
  382.  --z4'l{right}...z5l---z6l...{right}z7l
  383.  --z7r--z7'r{left}...z6r---z5r...{left}.5[z4r,z4'r]{right}
  384.  ...z3r---z2r...{right}z1'r--z1r--cycle;  % stroke
  385. penlabels(1,2,3,4,5,6,7); endchar;
  386.  
  387. iff known right_brace: cmchar "Right curly brace";
  388. beginchar(right_brace,9u#,body_height#,paren_depth#);
  389. italcorr math_axis#*slant+.5vair#-u#;
  390. adjust_fit(0,0); pickup fine.nib;
  391. forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
  392. forsuffixes $=2,3,5,6: pos$(stem,0); endfor
  393. x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
  394. rt x4r=hround(w-1.5u+.5vair); rt x2r=hround(.5w+.5stem);
  395. top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
  396. y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
  397. filldraw z1r{right}...z2r---z3r...{right}z4r
  398.  --z4'r{left}...z5r---z6r...{left}z7r
  399.  --z7l--z7'l{right}...z6l---z5l...{right}.5[z4l,z4'l]{left}
  400.  ...z3l---z2l...{left}z1'l--z1l--cycle;  % stroke
  401. penlabels(1,2,3,4,5,6,7); endchar;
  402.  
  403. iff known straight_quotes: cmchar "Straight double quotes";
  404. beginchar(straight_quotes,9u#,asc_height#,0);
  405. numeric top_width#,spread#; top_width#=if serifs: flare# else: stem# fi;
  406. spread#=max(3u#,top_width#+.5u#); define_pixels(spread);
  407. italcorr asc_height#*slant+.5top_width#+.5spread#-4u#;
  408. adjust_fit(0,0);
  409. x1=x2; x3=x4=w-x1; x3-x1=spread+2; y1=y3;
  410. y2=y4=max(.5[bar_height,x_height]+.5vair,h-x_height);
  411. if serifs: pickup crisp.nib; pos1(flare,0); pos2(vair,0);
  412.  pos3(flare,0); pos4(vair,0);
  413.  y1+.5stem=h; filldraw circ_stroke z1e--z2e;  % left stem and bulb
  414.  filldraw circ_stroke z3e--z4e;  % right stem and bulb
  415. else: pickup fine.nib; pos1(stem,0); pos2(vair,0);
  416.  pos3(stem,0); pos4(vair,0);
  417.  top y1=h; filldraw stroke z1e--z2e;  % left stem
  418.  filldraw stroke z3e--z4e; fi  % right stem
  419. penlabels(1,2,3,4); endchar;
  420.  
  421. iff known infty: cmchar "Infinity";
  422. beginchar(infty,18u#,x_height#,0);
  423. italcorr .7x_height#*slant-.5u#;
  424. adjust_fit(0,0); pickup fine.nib;
  425. numeric theta,phi;
  426. if monospace: phi=-theta=90;
  427. else: phi=angle(4u,h); theta=angle(6u,-h); fi
  428. pos1(vair,180); pos2(.5[vair,curve],90+.5theta); pos3(curve,90+theta);
  429. pos4(curve,90+theta); pos5(.5[vair,curve],90+.5theta);
  430. pos6(vair,180); pos7(.2[vair,curve],270+.5phi);
  431. pos8(.3[vair,curve],270+phi); pos9(.2[vair,curve],270+.5phi);
  432. lft x1r=w-rt x6l=hround u; x2=x9=.4[x1,x8]; x5=x7=.6[x8,x6];
  433. if monospace: x2l:=x2r; x5r:=x5l; x7r:=x7l; x9l:=x9r; fi
  434. y1=y6=.5h; top y2r=top y7l=h+oo; bot y5l=bot y9r=-oo;
  435. x8=.5[x3,x4]=.5w; y8=.5[y3,y4]=.5h;
  436. y3-y4=h/3; z3-z4=whatever*dir theta;
  437. filldraw stroke z1e{up}...z2e{right}...z3e---z4e...z5e{right}
  438.  ...z6e{up}...z7e{left}...{-dir phi}z8e...{left}z9e...z1e{up}; % bowls
  439. penlabels(1,2,3,4,5,6,7,8,9); endchar;
  440.  
  441. iff known integral: cmchar "Integral sign";
  442. beginchar(integral,5.25u#+max(1.25u#,stem#)+2max(1.5u#,curve#),
  443.  asc_height#,desc_depth#);
  444. italcorr asc_height#*slant-.5u#;
  445. adjust_fit(0,0); pickup fine.nib;
  446. pos1(curve,0); pos2(hair,0); pos3(vair,90); pos4(.6[hair,stem],180);
  447. pos5(stem,180); pos5'(stem,0); z5'=z5; pos6(.6[hair,stem],0);
  448. pos7(vair,-90); pos8(hair,-180); pos9(curve,-180);
  449. x7=w-x3=2.4u; rt x1r=max(rt x3+eps,hround(w-u)); x9=w-x1;
  450. x5=.5[x4,x6]; x4-x6=1.5u; lft x5r=hround(.5w-.5stem);
  451. y9-.5curve=vround(-.9d-o+vair); y3-y1=y9-y7;
  452. top y3r=h+o; bot y7r=-d-o; y5=.5[y3,y7]=.5[y4,y6]; y4-y6=2/3(y3-y7);
  453. bulb(3,2,1); bulb(7,8,9);  % bulbs
  454. filldraw stroke z3e{left}...z4e{(z5e-z4e)xscaled 1.1}
  455.  ..tension atleast 1 and atleast .8..{z5-z4}z5e;  % upper stem
  456. filldraw stroke z5'e{z6-z5}..tension atleast.8 and atleast 1
  457.  ..{(z6e-z5'e)xscaled 1.1}z6e...{left}z7e;  % lower stem
  458. math_fit(0,-2u#); penlabels(1,2,3,4,5,6,7,8,9); endchar;
  459.